package rpg.view;

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.*;
import rpg.narrativa.Narrativa;


/**
 * framePrincipal
 *
 * @author Gabriel Bronzatti Moro
 * @since 27/02/2013
 * @version 0.1
 */
public class framePrincipal extends JFrame {

    private Container principal;
    private JPanel panelCenario;
    private JPanel panelPersonagem;
    private JPanel panelRecursos;
    private JPanel panelDesafio;
    private JPanel panelNarrativa;
    /**
     * preciso dos Jpane de todos a interaçao ocorre aqui
     */
    public framePrincipal(Narrativa referencia) {
        super("RPG SOLO");
        this.principal= getContentPane();
        //INICIALIZAÇÃO DOS JPANES- Dentro desses vou chamar a parte de cada um
        this.panelCenario= new JPanel();
        this.panelPersonagem= new JPanel();
        this.panelRecursos= new JPanel();
        this.panelDesafio= new JPanel();
        this.panelNarrativa= new JPanel();
        
       this.panelNarrativa.setLayout(new BorderLayout());
       this.panelNarrativa.add(BorderLayout.NORTH,new PanelParadaCenario(referencia));
       this.panelNarrativa.add(BorderLayout.SOUTH,new paneFinalizar(referencia));
        
        //Panels devidamente alocados esperando seus devidos jpane's
       this.principal.setLayout(new BorderLayout());
       this.principal.add(BorderLayout.NORTH,this.panelPersonagem);
       this.principal.add(BorderLayout.SOUTH,this.panelNarrativa);
       this.principal.add(BorderLayout.WEST,this.panelRecursos);
       this.principal.add(BorderLayout.CENTER,this.panelCenario);
       this.principal.add(BorderLayout.EAST,this.panelDesafio);
       
        setSize(1024, 650);
        setResizable(false);
        setLocationRelativeTo(null);//Centraliza JFRAME
    }
}
